home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  5.9 KB  |  261 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Contains:    Definition of AIFF file format components.
  5.  
  6.      Version:    Technology:    System 8.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1989-1995, 1997-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __AIFF__
  18. #define __AIFF__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. enum {
  48.     AIFFID                        = FOUR_CHAR_CODE('AIFF'),
  49.     AIFCID                        = FOUR_CHAR_CODE('AIFC'),
  50.     FormatVersionID                = FOUR_CHAR_CODE('FVER'),
  51.     CommonID                    = FOUR_CHAR_CODE('COMM'),
  52.     FORMID                        = FOUR_CHAR_CODE('FORM'),
  53.     SoundDataID                    = FOUR_CHAR_CODE('SSND'),
  54.     MarkerID                    = FOUR_CHAR_CODE('MARK'),
  55.     InstrumentID                = FOUR_CHAR_CODE('INST'),
  56.     MIDIDataID                    = FOUR_CHAR_CODE('MIDI'),
  57.     AudioRecordingID            = FOUR_CHAR_CODE('AESD'),
  58.     ApplicationSpecificID        = FOUR_CHAR_CODE('APPL'),
  59.     CommentID                    = FOUR_CHAR_CODE('COMT'),
  60.     NameID                        = FOUR_CHAR_CODE('NAME'),
  61.     AuthorID                    = FOUR_CHAR_CODE('AUTH'),
  62.     CopyrightID                    = FOUR_CHAR_CODE('(c) '),
  63.     AnnotationID                = FOUR_CHAR_CODE('ANNO')
  64. };
  65.  
  66. enum {
  67.     NoLooping                    = 0,
  68.     ForwardLooping                = 1,
  69.     ForwardBackwardLooping        = 2
  70. };
  71.  
  72. enum {
  73.                                                                 /* AIFF-C Versions */
  74.     AIFCVersion1                = (long)0xA2805140
  75. };
  76.  
  77.  
  78.  
  79. /* Compression Names */
  80. #define NoneName "\pnot compressed"
  81. #define ACE2to1Name "\pACE 2-to-1"
  82. #define ACE8to3Name "\pACE 8-to-3"
  83. #define MACE3to1Name "\pMACE 3-to-1"
  84. #define MACE6to1Name "\pMACE 6-to-1"
  85.  
  86. enum {
  87.                                                                 /* Compression Types */
  88.     NoneType                    = FOUR_CHAR_CODE('NONE'),
  89.     ACE2Type                    = FOUR_CHAR_CODE('ACE2'),
  90.     ACE8Type                    = FOUR_CHAR_CODE('ACE8'),
  91.     MACE3Type                    = FOUR_CHAR_CODE('MAC3'),
  92.     MACE6Type                    = FOUR_CHAR_CODE('MAC6')
  93. };
  94.  
  95. typedef unsigned long                     ID;
  96. typedef short                             MarkerIdType;
  97.  
  98. struct ChunkHeader {
  99.     ID                                 ckID;
  100.     long                             ckSize;
  101. };
  102. typedef struct ChunkHeader                ChunkHeader;
  103.  
  104. struct ContainerChunk {
  105.     ID                                 ckID;
  106.     long                             ckSize;
  107.     ID                                 formType;
  108. };
  109. typedef struct ContainerChunk            ContainerChunk;
  110.  
  111. struct FormatVersionChunk {
  112.     ID                                 ckID;
  113.     long                             ckSize;
  114.     unsigned long                     timestamp;
  115. };
  116. typedef struct FormatVersionChunk        FormatVersionChunk;
  117. typedef FormatVersionChunk *            FormatVersionChunkPtr;
  118.  
  119. struct CommonChunk {
  120.     ID                                 ckID;
  121.     long                             ckSize;
  122.     short                             numChannels;
  123.     unsigned long                     numSampleFrames;
  124.     short                             sampleSize;
  125.     extended80                         sampleRate;
  126. };
  127. typedef struct CommonChunk                CommonChunk;
  128. typedef CommonChunk *                    CommonChunkPtr;
  129.  
  130. struct ExtCommonChunk {
  131.     ID                                 ckID;
  132.     long                             ckSize;
  133.     short                             numChannels;
  134.     unsigned long                     numSampleFrames;
  135.     short                             sampleSize;
  136.     extended80                         sampleRate;
  137.     ID                                 compressionType;
  138.     char                             compressionName[1];            /* variable length array, Pascal string */
  139. };
  140. typedef struct ExtCommonChunk            ExtCommonChunk;
  141. typedef ExtCommonChunk *                ExtCommonChunkPtr;
  142.  
  143. struct SoundDataChunk {
  144.     ID                                 ckID;
  145.     long                             ckSize;
  146.     unsigned long                     offset;
  147.     unsigned long                     blockSize;
  148. };
  149. typedef struct SoundDataChunk            SoundDataChunk;
  150. typedef SoundDataChunk *                SoundDataChunkPtr;
  151.  
  152. struct Marker {
  153.     MarkerIdType                     id;
  154.     unsigned long                     position;
  155.     Str255                             markerName;
  156. };
  157. typedef struct Marker                    Marker;
  158.  
  159. struct MarkerChunk {
  160.     ID                                 ckID;
  161.     long                             ckSize;
  162.     unsigned short                     numMarkers;
  163.     Marker                             Markers[1];                    /* variable length array */
  164. };
  165. typedef struct MarkerChunk                MarkerChunk;
  166. typedef MarkerChunk *                    MarkerChunkPtr;
  167.  
  168. struct AIFFLoop {
  169.     short                             playMode;
  170.     MarkerIdType                     beginLoop;
  171.     MarkerIdType                     endLoop;
  172. };
  173. typedef struct AIFFLoop                    AIFFLoop;
  174.  
  175. struct InstrumentChunk {
  176.     ID                                 ckID;
  177.     long                             ckSize;
  178.     UInt8                             baseFrequency;
  179.     UInt8                             detune;
  180.     UInt8                             lowFrequency;
  181.     UInt8                             highFrequency;
  182.     UInt8                             lowVelocity;
  183.     UInt8                             highVelocity;
  184.     short                             gain;
  185.     AIFFLoop                         sustainLoop;
  186.     AIFFLoop                         releaseLoop;
  187. };
  188. typedef struct InstrumentChunk            InstrumentChunk;
  189. typedef InstrumentChunk *                InstrumentChunkPtr;
  190.  
  191. struct MIDIDataChunk {
  192.     ID                                 ckID;
  193.     long                             ckSize;
  194.     UInt8                             MIDIdata[1];                /* variable length array */
  195. };
  196. typedef struct MIDIDataChunk            MIDIDataChunk;
  197. typedef MIDIDataChunk *                    MIDIDataChunkPtr;
  198.  
  199. struct AudioRecordingChunk {
  200.     ID                                 ckID;
  201.     long                             ckSize;
  202.     UInt8                             AESChannelStatus[24];
  203. };
  204. typedef struct AudioRecordingChunk        AudioRecordingChunk;
  205. typedef AudioRecordingChunk *            AudioRecordingChunkPtr;
  206.  
  207. struct ApplicationSpecificChunk {
  208.     ID                                 ckID;
  209.     long                             ckSize;
  210.     OSType                             applicationSignature;
  211.     UInt8                             data[1];                    /* variable length array */
  212. };
  213. typedef struct ApplicationSpecificChunk    ApplicationSpecificChunk;
  214. typedef ApplicationSpecificChunk *        ApplicationSpecificChunkPtr;
  215.  
  216. struct Comment {
  217.     unsigned long                     timeStamp;
  218.     MarkerIdType                     marker;
  219.     unsigned short                     count;
  220.     char                             text[1];                    /* variable length array, Pascal string */
  221. };
  222. typedef struct Comment                    Comment;
  223.  
  224. struct CommentsChunk {
  225.     ID                                 ckID;
  226.     long                             ckSize;
  227.     unsigned short                     numComments;
  228.     Comment                         comments[1];                /* variable length array */
  229. };
  230. typedef struct CommentsChunk            CommentsChunk;
  231. typedef CommentsChunk *                    CommentsChunkPtr;
  232.  
  233. struct TextChunk {
  234.     ID                                 ckID;
  235.     long                             ckSize;
  236.     char                             text[1];                    /* variable length array, Pascal string */
  237. };
  238. typedef struct TextChunk                TextChunk;
  239. typedef TextChunk *                        TextChunkPtr;
  240.  
  241. #if PRAGMA_STRUCT_ALIGN
  242.     #pragma options align=reset
  243. #elif PRAGMA_STRUCT_PACKPUSH
  244.     #pragma pack(pop)
  245. #elif PRAGMA_STRUCT_PACK
  246.     #pragma pack()
  247. #endif
  248.  
  249. #ifdef PRAGMA_IMPORT_OFF
  250. #pragma import off
  251. #elif PRAGMA_IMPORT
  252. #pragma import reset
  253. #endif
  254.  
  255. #ifdef __cplusplus
  256. }
  257. #endif
  258.  
  259. #endif /* __AIFF__ */
  260.  
  261.